home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / Oberon⁄F™ 1.2 / Preinstalled version / Obx / Docu / Address0 (.txt) < prev    next >
Encoding:
Oberon Document  |  1996-07-08  |  15.2 KB  |  71 lines  |  [oODC/obnF]

  1. Documents.StdDocumentDesc
  2. Documents.DocumentDesc
  3. Containers.ViewDesc
  4. Views.ViewDesc
  5. Stores.StoreDesc
  6. Documents.ModelDesc
  7. Containers.ModelDesc
  8. Models.ModelDesc
  9. Stores.ElemDesc
  10. TextViews.StdViewDesc
  11. TextViews.ViewDesc
  12. TextModels.StdModelDesc
  13. TextModels.ModelDesc
  14. TextModels.AttributesDesc
  15. Helvetica
  16. Helvetica
  17. Helvetica
  18. Helvetica
  19. Helvetica
  20. TextRulers.StdRulerDesc
  21. TextRulers.RulerDesc
  22. TextRulers.StdStyleDesc
  23. TextRulers.StyleDesc
  24. TextRulers.AttributesDesc
  25. Helvetica
  26. MODULE ObxAddress0;
  27.         adr*: RECORD
  28.             name*:    ARRAY 64 OF CHAR;
  29.             street*:    ARRAY 64 OF CHAR;
  30.             city*:    ARRAY 24 OF CHAR;
  31.             state*:    ARRAY   6 OF CHAR;
  32.             ZIP*:    ARRAY   6 OF CHAR;
  33.             country*:    ARRAY 16 OF CHAR;
  34.             customer*:    LONGINT;
  35.             update*:    BOOLEAN;
  36.             Text*:    PROCEDURE
  37.         END;
  38. END ObxAddress0.
  39. TextControllers.StdCtrlDesc
  40. TextControllers.ControllerDesc
  41. Containers.ControllerDesc
  42. Controllers.ControllerDesc
  43. Helvetica
  44. HostPictures.StdViewDesc
  45. Oberon by Example: ObxAddress0
  46. One of the hallmarks of modern user interfaces are modeless dialog boxes and data entry forms. They feature text entry fields, push buttons, check boxes, and a variety of other so-called controls. Oberon/F addresses these issues in a unique way:
  47. - new controls can be implemented in Oberon itself; they are just specialized views
  48. - every view which may contain other views (i.e. a container view) can thus contain controls, and
  49.    each container view can be turned into an input mask when desired
  50. - controls can be directly linked to variables of a program
  51. - linking is done automatically, taking into account type information about the variables to
  52.    guarantee consistency
  53. - initial form layouts can be generated automatically out of a record declaration
  54. - forms can be edited interactively and stored as documents, no intermediate code generation
  55.    is necessary
  56. - yet form layouts may be created or manipulated by an Oberon program, if this is desired.
  57. Some of these aspects can be demonstrated with the example below:
  58. Compile this module and then execute New
  59. Form... in the Dev menu. A dialog will be opened. Now type "ObxAddress0.adr" into its link field, and then click on the default button. A new window with the following contents will be opened:
  60. This form layout can be edited, e.g. by moving the Text button somewhat to the right. (Note that you have modified the document by doing that, thus you will be asked whether to save it when you try to close it. Don't save this one.
  61. Now execute the Open as
  62. Dialog command in the Dev menu. As a result, you get a fully functional dialog with the current layout. This mask can be used right away, i.e. when you click into the update check box, the variable ObxAddress0.adr.update will be toggled!
  63. Note that if you click on the Text button, an error message will be displayed; because the corresponding procedure variable has not yet been set up.
  64. If you have several views on the same variable (e.g. both the layout and the mask window), all of them will reflect the changes to the input you  make.
  65. A form's controls are linked to a program variable in a similar way as a text view is linked to its text. Both text views and controls are extensions of the type Views.View. The container of the above controls is a form view, also an extension of Views.View. Form views, just as text views, are examples of container views: container views may contain some intrinsic contents (e.g. text pieces) as well as arbitrary other views.
  66. Instead of starting with a record declaration as in the above example, you may prefer to start with the interactive design of a dialog, and only later turn to the programming aspects. This is perfectly possible as well: click on the Empty command button to create a new empty form. It will be opened in a new window, and the Layout and Controls menus will appear. Using the commands in the Controls menu, new controls can be inserted into the form. The form can be saved in a file, and its controls may later be connected to program variables using a tool called the control property editor (see the description of the Edit menu in the User's Guide).
  67. Oberon/F only supports modeless forms, whether used as data entry masks or as dialogs. Modal forms would force the user to complete a certain task before doing anything else, e.g. looking up additional information on his task. Oberon/F follows the philosophy that the user should be in control, not the computer.
  68. In this example we have seen how a form is used, from the perspective of a programmer as well as from the perspective of a user interface designer. Furthermore we have seen how an initial form layout can be generated automatically, how a form can be viewed (even simultaneously) both as a layout and as a dialog, and how a control, like any other view, may live in an arbitrary container view, not just in a form view.
  69. Helvetica
  70. Documents.ControllerDesc
  71.